package com.jbl.ma.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jbl.commonutils.R;
import com.jbl.ma.entity.UserRejectReason;
import com.jbl.ma.service.UserRejectReasonService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author jbl
 * @since 2020-12-11
 */

@CrossOrigin
@RestController
@RequestMapping("/ma/user-reject-reason")
public class UserRejectReasonController {
    @Autowired
    private UserRejectReasonService userRejectReasonService;

    @GetMapping("/list")
    @ApiOperation("获取驳回类型列表")
    public R list() {
        List<UserRejectReason> list = userRejectReasonService.list(
                new QueryWrapper<UserRejectReason>().orderByDesc("reject_type")
        );
        return R.ok().data("rejectList", list);
    }
}
